//
//  BaseTabBarController.m
//  BaseProject
//
//  Created by 陈家将 on 16/9/21.
//  Copyright © 2016年 szteyou. All rights reserved.
//

#import "BaseTabBarController.h"
#import "BaseNavigationController.h"

@interface BaseTabBarController ()

@end

@implementation BaseTabBarController

#pragma mark - **** instance ****


#pragma mark - **** system callback ****

- (void)viewDidLoad {
    [super viewDidLoad];
    [self commonInit];
    
//    隐藏tabBar
    self.tabBar.hidden = YES;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
}


#pragma mark - **** setter & getter ****

- (void)setShowMenusBlock:(ShowMenusCallBack)showMenusBlock {
    _showMenusBlock = showMenusBlock;
    
    for(BaseNavigationController* naviVc in self.childViewControllers){
        BaseViewController *NaviRootVc = naviVc.childViewControllers.firstObject;
        NaviRootVc.showMenusBlock = showMenusBlock;
    }
}


#pragma mark - **** private method ****


/// 初始化子控制器
- (void)commonInit {
//    // 首页
//    HomeViewController *homeVc = [[HomeViewController alloc] init];
//    BaseNavigationController *homeNaviVc = [[BaseNavigationController alloc] initWithRootViewController:homeVc];
//    //附近
//    NearByViewController *nearbyVc = [[NearByViewController alloc] init];
//    BaseNavigationController *nearbyNaviVc = [[BaseNavigationController alloc] initWithRootViewController:nearbyVc];
//    // 钱包
//    WalletViewController *walletVc = [[WalletViewController alloc] init];
//    BaseNavigationController *walletNaviVc = [[BaseNavigationController alloc] initWithRootViewController:walletVc];
//    //账户
//    AccountViewController *accountVc = [[AccountViewController alloc] init];
//    BaseNavigationController *accountNaviVc = [[BaseNavigationController alloc] initWithRootViewController:accountVc];
//    // 设置
//    SettingViewController *settingVc = [[SettingViewController alloc] init];
//    BaseNavigationController *settingNaviVc = [[BaseNavigationController alloc] initWithRootViewController:settingVc];
//    
//    
//    self.viewControllers = @[homeNaviVc,nearbyNaviVc,walletNaviVc,accountNaviVc,settingNaviVc];
//    
//    // 自定义item字体颜色
//    for (BaseNavigationController *vc in self.viewControllers) { // Tabbar设置
//        [vc.tabBarItem setTitleTextAttributes:@{NSForegroundColorAttributeName : COLOR_GRAY,
//                                                NSFontAttributeName : [UIFont systemFontOfSize:11.0]}
//                                     forState:UIControlStateNormal]; // 设置Item未选中颜色
//        [vc.tabBarItem setTitleTextAttributes:@{NSForegroundColorAttributeName : COLOR_NAV_BACKGROUND}
//                                     forState:UIControlStateSelected]; // 设置Item选中颜色
//        [vc.tabBarItem setTitlePositionAdjustment: UIOffsetMake(0, -3)];
//    }
//    
//    // 主题
//    UITabBar *appearance = [UITabBar appearance];
//    appearance.tintColor = COLOR_NAV_BACKGROUND;
}

@end
